package com.neusoft.demo3;

/**
 * 1. 如果查询到的数据返回的是一条数据，这个方法就可以返回一个对象
 * 2. 如果用户输入的信息比较多，方法的参数就可以传对象
 */
public class UserManager {

    /**
     * select * from student where username = ? and password = ?;
     * @param student
     * @return
     */
    public Student login(Student student) {
        return null;
    }

    /**
     * 查询所有学生信息
     * select * from student;-----多条数据
     */
    public Student[] getQueryAll() {
        return null;
    }
    /**
     * 根据id查询某个用户
     * select * from student where id = 1
     */
    public Student queryById(int id) {
        Student s = new Student();
        s.setSname("tom");
        return s;
    }


    /**
     * 注册学生信息
     * insert into student(name,phone,email) values(?,?,?)
     */
    public boolean register(Student student) {
        System.out.println(student.getSname());
        return false;
    }


    public static void main(String[] args) {
        UserManager manager = new UserManager();
        Student s1 = manager.queryById(100);
        System.out.println(s1.getSname());

        Student s = new Student();
        s.setSname("fender");
        boolean s2 = manager.register(s);
        System.out.println(s2);


    }
}
